<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let str = 'abc';
        // let num = 123;
        // let fn = ()=>{
        //     console.log(123);
        // }

        // console.log(typeof str);
        // console.log(typeof num);
        // console.log(typeof fn);


        // 声明调用Symbol 返回一个独一无二的值
        // let s1 = Symbol();
        // let s2 = Symbol();

        // console.log(s1);
        // console.log(s2);

        // // 不相等
        // console.log(s1 === s2);

        // console.log(typeof s1); //symbol


        // 小明
        let obj = {
            name:"laowang",
            age:19,
            sex:"男"
        }

        // 小王 - 命名冲突

        let s1 = Symbol('退休年龄');
        // obj.age = 66;
        obj[s1] = 66;

        let s2 = Symbol('退休工资');

        obj[s2] = 888;

        console.log(obj);

        console.log(obj[s2]);
        console.log(obj[s1]);


    </script>
</body>
</html>